<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>特殊价格体系列表</title>
    <link rel="icon" href="favicon.ico" type="image/x-icon" />
<#include "../template/include/assign.ftl">
<#include "../template/include/source.ftl">
<#include "../template/template_listPage.ftl">
    <link href="${web_static}/admin/css/list.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .page{
            float:right;
            padding-top: 15px;
            margin-right: 15px;
        }
    </style>
    <script type="text/javascript">

        $(document).ready(function () {

            var $validateErrorContainer = $("#validateErrorContainer");
            var $validateErrorLabelContainer = $("#validateErrorContainer ul");
            var $validateForm = $("#inputForm");
            var $tab = $("#tab");
            // Tab效果
            $tab.tabs(".tabContent", {
                tabs:"input"
            });

            // 表单验证
            $validateForm.validate({
                errorContainer:$validateErrorContainer,
                errorLabelContainer:$validateErrorLabelContainer,
                wrapper:"li",
                errorClass:"validateError",
                ignoreTitle:true,
                rules:{
                    "templateName":{
                        required:true
                    }
                },
                messages:{
                    "templateName":{
                        required:"请选择模板名称！！"
                    }
                },
                submitHandler:function (form) {
                    //$(form).find(":submit").attr("disabled", true);
                    form.submit();
                }
            });


        <#if actionErrors?? && (actionErrors?size > 0)>
            $.dialog({type:"warn", content:"<#list errorMessages as list>${list}<br></#list>", modal:true, autoCloseTime:3000});
        </#if>

        });


        function chk_dl(id){
            var result = confirm("确定要删除这条数据吗？");
            if(result){
                var url="${web_base}/game/game_special_price!delete.htm?id="+id;
                document.forms[1].action=url;
                document.forms[1].submit();
            }
        }
        function editSpecial(goodsId,templateCode) {
            var goodId = $('#goodId').val();
            var tempCode = $('#tempCode').val();
            var tempNa = $('#templateName').val();
            var brandNa = $('#brandName').val();
            var url = "${web_base}/game/game_special_price!toEdit.htm?goodsId=" + goodsId+"&templateCode="+templateCode;
            if (goodId != null && goodId != '') {
                url = url + "&goodId=" + goodId;
            }
            if(tempCode != null && tempCode != ''){
                url = url + "&tempCode=" + tempCode;
            }
            if(tempNa != null && tempNa != ''){
                url = url + "&templateName=" + tempNa;
            }
            if(brandNa != null && brandNa != ''){
                url = url + "&brandName=" + brandNa;
            }
            document.forms[1].action = encodeURI(url);
            document.forms[1].submit();
        }
         <#--function exportor() {-->
        <#---->
            <#--var data = $('#inputForm').serialize();-->
            <#--var url = "${web_base}/game/game_special_price!export.htm?";-->
            <#--if (data != undefined && data != '') {-->
                <#--url = url + data;-->
                <#--$('#download').attr('src',url);-->
            <#--}-->
            <#---->
       <#---->
    <#--}-->
    
    	 function noticeUser(goodsId,templateCode){
	      	 var url = "${web_base}/game/game_special_price!noticeUser.htm?goodsId=" + goodsId + "&templateCode=" + templateCode;
	      	 document.forms[1].action = encodeURI(url);
	         document.forms[1].submit();
       	}
    </script>
</head>
<body class="list">
<div class="body">
    <div class="listBar">
        <h1><span class="icon">&nbsp;</span>特殊价格体系列表&nbsp;<span class="pageInfo"></span></h1>
    </div>
    <div style="display: none;" id="validateErrorContainer" class="validateErrorContainer">
        <div class="validateErrorTitle">以下信息填写有误,请重新填写</div>
        <ul></ul>
    </div>
    <div class="operateBar">
        &nbsp;&nbsp;&nbsp;&nbsp;
        <input type="button" onclick="location.href='${web_base}/game/game_special_price!add.htm'" class="addButton" value="设置价格" />
        <input type="button" onclick="location.href='${web_base}/game/game_special_price!toCopy.htm'" class="addButton" value="复制模板" />
    </div>
    <form id="inputForm" class="validate" action="${web_base}/game/game_special_price!export.htm" method="post" >
        <div class="operateBar">
            <label>请选择模板名称：</label>
            <select name="templateName" class="formText {required: true}">
                <option value="" selected="selected">
                    -请选择模板名称-
                </option>
            <#if templateNameList??>
                <#list templateNameList as obj>
                    <option value="${obj!}">${obj!}</option>
                </#list>
            </#if>
            </select>
            &nbsp;&nbsp;&nbsp;&nbsp;
             品牌名称：<input type="text" name="brandName" value="" />
            <input type="submit"  id="exportButton" value="导出模板价格信息"/>
        </div>
    </form>
<@pageList page=(page!) id="listForm" action="${web_base}/game/game_special_price!list.htm" query="gameSpecialPriceQuery" isEmpty=true>
    <div class="operateBar">
        <label>查找:</label>
        模板编号：&nbsp;&nbsp;<input type="text" name="gameSpecialPriceQuery.templateCode" id="tempCode" value="<#if gameSpecialPriceQuery??>${(gameSpecialPriceQuery.templateCode)!}</#if>" />
        模板名称：<input type="text" name="gameSpecialPriceQuery.templateName" id="templateName" value="<#if gameSpecialPriceQuery??>${(gameSpecialPriceQuery.templateName)!}</#if>" />
        商品编号：<input type="text" name="gameSpecialPriceQuery.goodsId"  id="goodId" value="<#if gameSpecialPriceQuery??>${(gameSpecialPriceQuery.goodsId)!}</#if>" />
        品牌名称：<input type="text" name="gameSpecialPriceQuery.brandName"  id="brandName" value="<#if gameSpecialPriceQuery??>${(gameSpecialPriceQuery.brandName)!}</#if>" />
        <input type="submit" id="searchButton" class="searchButton" value="" />
    </div>
    <table class="listTable">
        <tr>
            <th>
                <span class="sort" name="templateCode">模板编号</span>
            </th>
            <th>
                <span class="sort" name="templateName">模板名称</span>
            </th>
            <th>
                <span class="sort" name="goodsId">商品编号</span>
            </th>
            <th>
                <span class="sort" name="goodsName">商品名称</span>
            </th>
            <th>
                <span class="sort" name="brandName">品牌名称</span>
            </th>
            <th>
                <span class="sort" name="inPrice">售价(元)</span>
            </th>
            <th>
                <span class="sort" name="insertTime">录入时间</span>
            </th>
            <th>
                <span class="sort" name="modifyTime">更新时间</span>
            </th>
            <th>
                <span class="sort" name="operator">操作员</span>
            </th>
            <th width="80">操&nbsp;&nbsp;&nbsp;&nbsp;作<th/>
        </tr>

        <#if page?? && page.list?? && (page.list?size gt 0)>
            <#list page.list as obj>
                <tr>
                    <td>
                    ${(obj.templateCode)!}
                    </td>
                    <td>
                    ${(obj.templateName)!}
                    </td>
                    <td>
                    ${(obj.goodsId)!}
                    </td>
                    <td>
                        <a title="${(obj.goodsName)!}">
                            <#if obj.goodsName?? && obj.goodsName?length gte 15>
                            <#--//截取输出文字的长度-->
                            ${obj.goodsName?substring(0,15)}...
                            <#else>
                            ${(obj.goodsName)!}
                            </#if>
                        </a>
                    </td>
                    <td>
                        <a title="${(obj.brandName)!}">
                            <#if obj.brandName?? && obj.brandName?length gte 15>
                            <#--//截取输出文字的长度-->
                                ${obj.brandName?substring(0,15)}...
                            <#else>
                                ${(obj.brandName)!}
                            </#if>
                        </a>
                    </td>
                    <td>
                    ${(obj.inPrice*1.0/1000)?string("0.000")!}
                    </td>
                    <td>
                    ${(obj.insertTime)!}
                    </td>
                    <td>
                    ${(obj.modifyTime)!}
                    </td>
                    <td>
                    ${(obj.operator)!}
                    </td>
                    <td width="80">
                        <span class="spanLink" onclick="editSpecial('${(obj.goodsId)!}','${(obj.templateCode)!}');" title="编辑">[编辑]</span>
                        <a href="${web_base}/game/game_special_price!queryById.htm?goodsId=${(obj.goodsId)!}&templateCode=${(obj.templateCode)!}" title="详情">[详情]</a>
                        <#--<span class="spanLink" onclick="chk_dl('${(obj.id)!}');" title="删除">[删除]</span>-->
                   		<br>
                        <span class="spanLink" onclick="noticeUser('${obj.goodsId}','${obj.templateCode}');"
                              title="通知下游">[通知下游]</span>
					</td>
                </tr>
            </#list>
        </#if>
    </table>

    <#if page?? && page.list?? && (page.list?size <= 0)>
        <div class="noRecord">
            没有找到任何记录!
        </div>
    </#if>
</@pageList>
<#--<iframe id="download" style="display: none;"></iframe>-->
</div>

</body>
</html>